oracle.hadoop.balancer.examples.invindx

## Class InvertedIndexMapreduce.InvertedIndexReducer

- java.lang.Object
- - org.apache.hadoop.mapreduce.Reducer<InvertedIndex.InvertedIndexKey,InvertedIndex.InvertedIndexValue,org.apache.hadoop.io.Text,org.apache.hadoop.io.Text>
  - - oracle.hadoop.balancer.examples.invindx.InvertedIndexMapreduce.InvertedIndexReducer

- Enclosing class:
    InvertedIndexMapreduce

      public static class InvertedIndexMapreduce.InvertedIndexReducer
      extends org.apache.hadoop.mapreduce.Reducer<InvertedIndex.InvertedIndexKey,InvertedIndex.InvertedIndexValue,org.apache.hadoop.io.Text,org.apache.hadoop.io.Text>

  The inverted index reducer class for mapreduce API

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from class org.apache.hadoop.mapreduce.Reducer

      `org.apache.hadoop.mapreduce.Reducer.Context`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `InvertedIndexMapreduce.InvertedIndexReducer()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `reduce(InvertedIndex.InvertedIndexKey key, java.lang.Iterable<InvertedIndex.InvertedIndexValue> values, org.apache.hadoop.mapreduce.Reducer.Context context)` The reduce function.
    `void` | `setup(org.apache.hadoop.mapreduce.Reducer.Context context)`

    - ### Methods inherited from class org.apache.hadoop.mapreduce.Reducer

      `run`

    - ### Methods inherited from class java.lang.Object

      `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### InvertedIndexMapreduce.InvertedIndexReducer

          public InvertedIndexMapreduce.InvertedIndexReducer()

  - ### Method Detail

    - #### reduce

          public void reduce(InvertedIndex.InvertedIndexKey key,
                    java.lang.Iterable<InvertedIndex.InvertedIndexValue> values,
                    org.apache.hadoop.mapreduce.Reducer.Context context)
                      throws java.io.IOException,
                             java.lang.InterruptedException

      The reduce function. The output per line is:
      - word <location:offset:numOccurrencesAtOffset>
      Since the values per key are in sorted order, we can merge consecutive duplicate locations per word.
      Overrides:
        `reduce` in class `org.apache.hadoop.mapreduce.Reducer<InvertedIndex.InvertedIndexKey,InvertedIndex.InvertedIndexValue,org.apache.hadoop.io.Text,org.apache.hadoop.io.Text>`
      Throws:
        `java.io.IOException`
        `java.lang.InterruptedException`

    - #### setup

          public void setup(org.apache.hadoop.mapreduce.Reducer.Context context)

      Overrides:
        `setup` in class `org.apache.hadoop.mapreduce.Reducer<InvertedIndex.InvertedIndexKey,InvertedIndex.InvertedIndexValue,org.apache.hadoop.io.Text,org.apache.hadoop.io.Text>`

Copyright © 2013, 2014, Oracle and/or its affiliates. All rights reserved.